package com.haitonghop.modules.local;

import java.util.ArrayList;

import com.haitonghop.R;
import com.haitonghop.data.TamDiemMetalData;
import com.haitonghop.utils.sqllite.datasource.TopicHaiBlData;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class LocalViewTopicRenderAdapter extends ArrayAdapter<TopicHaiBlData> {

	ArrayList<TopicHaiBlData> blockList = null;

	public LocalViewTopicRenderAdapter(Context context, int resource, int textViewResourceId, ArrayList<TopicHaiBlData> objects) {
		super(context, resource, textViewResourceId, objects);
		this.blockList = objects;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub

		LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View rowHeader = inflater.inflate(R.layout.localview_topic_render_modules, parent, false);
		TextView header = (TextView) rowHeader.findViewById(R.id.nameView);
		TextView subCaption = (TextView) rowHeader.findViewById(R.id.captionView);
		
		TopicHaiBlData module = this.blockList.get(position);
		header.setText(module.getName());
		subCaption.setVisibility(View.GONE);
		
		return rowHeader;
	}



}
